package com.ibeeking.found.msg.rest.controller.v1;


import com.ibeeking.found.msg.rest.service.IWxMpFansTagsService;
import com.ibeeking.found.msg.service.common.param.WxMpTagsFansBatchParam;
import com.ibeeking.found.msg.service.common.param.WxMpTagsFansCancelParam;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author ibeeking
 * 粉丝标签关系
 */
@RestController
@RequestMapping("/b/wxMp/fansTags/v1")
public class WxMpFansTagsController {

    @Resource
    private IWxMpFansTagsService mpFansTagsServiceImpl;

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "给粉丝打标签")
    @PostMapping(value = "/taggingFans")
    public Boolean taggingFans(@RequestBody @Validated WxMpTagsFansBatchParam param) {
        return mpFansTagsServiceImpl.taggingFans(param);
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "去除指定标签")
    @PostMapping(value = "/removeFansTagsByTagsId")
    public Boolean removeFansTagsByTagsId(@RequestBody @Validated WxMpTagsFansCancelParam param) {
        return mpFansTagsServiceImpl.removeFansTagsByTagsId(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询粉丝关联的标签id列表")
    @PostMapping(value = "/queryByFansId/{fansId}")
    public List<String> queryByFansId(@PathVariable("fansId") Long fansId) {
        return mpFansTagsServiceImpl.queryByFansId(fansId);
    }
}
